﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Smart.Data
{
    /// <summary>
    /// SqlClient 数据源
    /// </summary>
    public class SqlServerDataSource : DataSource
    {
        public SqlServerDataSource() : this("master") { }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="service">数据库名称</param>
        public SqlServerDataSource(string service)
        {
            Server = ".";
            Port = "1433";
            Model = service;
            Provider = "System.Data.SqlClient";
            FormatString = "Data Source={0};Initial Catalog={1};Persist Security Info=True;User Id={3};Password={4}";
        }

        public override string ToConnectionString()
        {
            return string.Format(FormatString, Server, Model, Port, UserName, Password);
        }
    }
}
